package tt;

import java.util.Arrays;
import java.util.List;

public class asd {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("Krishna", "Mahesh", "Kush");
        String[] strArray = list.stream()
                .filter(e -> e.startsWith("K"))
                .toArray(size -> {
                    System.out.println("size"+size);
                    return new String[size];});
        for(String s : strArray) {
            System.out.println(s);
        }
    }
}
